#!/usr/bin/env python2.5
# encoding: utf-8

if not globals().has_key("esda"):
    execfile("esda.py")
    sys.exit()

init()

import random

name = "Stream"

newStream(name)

for j in range(10):
    streams[name][4*j+1:4*j+3] = random.random()

def filterForStream(startTime, endTime, value):
    if value > 0.2:
        return True
    else:
        return False

def startTimeFilterForStream(startTime, endTime, value):
    return startTime - 1

def endTimeFilterForStream(startTime, endTime, value):
    return endTime + 1

newFilterStream(
    "FilteredStream", "Stream",
    filter=filterForStream,
    startTimeFilter=startTimeFilterForStream,
    endTimeFilter=endTimeFilterForStream)

